package org.itboys.rpc.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.itboys.dto.base.Result;
import org.itboys.rpc.service.BaseRpcService;
import org.itboys.rpc.service.sms.ValidateCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 发送验证码
 * @author weisky
 *
 */
@Controller
@RequestMapping("/rpc/validatecode")
public class RpcValidateCodeController extends BaseRpcService{

	@Autowired
	private ValidateCodeService validateCodeService;
	
	/**
	 * 发送验证码
	 * @param mobile
	 * @param type:验证类型    1：注册   2：忘记密码   3：修改密码
	 * @param request
	 * @param response
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/send")
	public Result<Void> sendValidateCode(String mobile, int type,
			 HttpServletRequest request,HttpServletResponse response){
		return validateCodeService.sendValidateCode(mobile, type);
	}
}
